package com.mapper;

import com.pojo.Cclass;
import org.apache.ibatis.annotations.*;

/**
 * @author lenove
 * @description 针对表【c_class】的数据库操作Mapper
 * @createDate 2024-11-15 11:31:00
 * @Entity com.pojo.Cclass
 */
public interface CclassMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Cclass record);

    int insertSelective(Cclass record);

    Cclass selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Cclass record);

    int updateByPrimaryKey(Cclass record);

    @Select("SELECT * FROM c_class WHERE id = #{cla}")
    @Results({
            @Result(id = true, property = "id", column = "id"),
            @Result(property = "classname", column = "classname")
    })
    Cclass selectClassById(int id);
    @Select("SELECT * FROM c_class WHERE id = #{id}")
    @Results({
            @Result(id = true, property = "id", column = "id"),
            @Result(property = "classname", column = "classname"),
            @Result(column = "id",property = "studentsList",
                    many = @Many(select = "com.mapper.StudentsMapper.selectStudentsById"))
    })
    Cclass selectClassaById(int id);
}